package cn.com.bluemoon.daps.api.sys;

import cn.com.bluemoon.daps.api.sys.factory.RemoteSystemUserServiceFallbackFactory;
import cn.com.bluemoon.daps.common.annotation.FcApiFor;
import cn.com.bluemoon.daps.common.constant.ServiceNameConstants.DapsApiSystem;
import cn.com.bluemoon.daps.common.domain.ResultBean;
import cn.com.bluemoon.daps.system.dto.SystemUserDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;

import java.util.List;

@FeignClient(value = DapsApiSystem.SERVICE, fallbackFactory = RemoteSystemUserServiceFallbackFactory.class)
@RequestMapping(DapsApiSystem.BASE_URI + DapsApiSystem.API_SYS_USER)
@ApiIgnore
public interface RemoteSystemUserService {
    /**
     * 1
     *
     * @return 获取系统用户列表
     */
    @GetMapping("/list")
    @FcApiFor(team = {"数据资产团队", "数据工具团队"})
    ResultBean<List<SystemUserDto>> list();

    /**
     * dba用户
     * @return  dba用户
     */
    @GetMapping("/user/dba")
    @FcApiFor(team = {"数据资产团队", "数据工具团队"})
    ResultBean<List<SystemUserDto>> userDba();

    /**
     * 获取账号信息（若不存在则忽略）
     */
    @PostMapping("/list/users")
    ResultBean<List<SystemUserDto>> listByAccount(@RequestBody List<String> accounts);
}
